#include <iostream>
using namespace std;

/*
    【题目211】声明一个哺乳动物Mammal类，再由此派生出狗Dog类，声明一个Dog类的
    对象，观察基类与派生类的构造函数与析构函数的调用顺序。
*/

class Mammal
{
public:
    Mammal()
    {
        cout << "Mammal()" << endl;
    }
    ~Mammal()
    {
        cout << "~Mammal()" << endl;
    }
};

class Dog : public Mammal
{
public:
    Dog()
    {
        cout << "Dog()" << endl;
    }
    ~Dog()
    {
        cout << "~Dog()" << endl;
    }
};

int main()
{
    Dog dog;
    return 0;
}